package dao;

import mappings.Plugins;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import utils.HibernateUtil;

import java.util.List;

public class PluginsDao
{
    private static SessionFactory sessionFactory = HibernateUtil.getSessionFactory();

    public List<Plugins> getAllPlugins()
    {
        Session session = sessionFactory.openSession();

        List<Plugins> plugins = session.createCriteria(Plugins.class)
                .list();

        session.close();

        return plugins;
    }
}
